-
February 21st, 2002, 05:26 PM
#1
TastinGood
Guest
#include <iostream.h>
#include <stdio.h>
int printcharacter(char ch)
{
switch(ch)
{ case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
return 1;
default:
return 0;
}
}
void main()
{
char ch;
int vowel;
cout << "Enter character: " << endl;
while ((ch = getchar()) !='\n')
{
vowel = printcharacter (ch);
if (printcharacter(ch))
cout << ch << " is a vowel" << endl;
else
cout << ch << " is a consonant" << endl;
}
}
Oh yes....I am the man!
------------------
-
February 21st, 2002, 08:18 PM
#2
Senior Hostboard Member
That's either a Basic program, or a C program to get a program to have the user input a character, and when he does the program either tells him if it's a vowel or a consonant.
But I don't see where your allowing the input from the user.
YOu have to remember, users need instruction!
------------------
As miserable as life may be I hold it pretty precious...
If I lose the light of the sun, I will write by candlelight, moonlight, no light. If I lose paper and ink, I wil write in blood on forgotten walls. I will write always, I will capture nights all over the world and bring them to you.
Word And Voice
Motocross Fanatics
General Philosophy
-
February 21st, 2002, 10:19 PM
#3
TastinGood
Guest
<BLOCKQUOTE><font size="1" face="Bradley Hand ITC, Tahoma, Lucinda Console">quote:</font><HR>Originally posted by TastinGood:
cout << "Enter character: " << endl;
<HR></BLOCKQUOTE>
------------------
[This message has been edited by TastinGood (edited February 21, 2002).]
-
February 22nd, 2002, 03:24 PM
#4
Inactive Member
what's wrong with printf?
------------------
Sure the universe is a great place, but if it wasn't here, no-one would miss it.
-
February 22nd, 2002, 11:41 PM
#5
Inactive Member
that is sad....you have been in that class for over a month, and that is the best you can do.
------------------
Look at that. She think I got siphlus and TB and a hard on and I gonna cut her up with a razor and lif her purse. Ooo-Wee.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks